<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('会议列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>会议名称：</label>
                                <input type="text" name="conferenceName"/>
                            </li>
                            <li>
                                <label>会议开始时间：</label>
                                <input type="text" class="time-input" placeholder="请选择会议开始时间;会议开始时间" name="beginTime"/>
                            </li>
                            <li>
                                <label>会议结束时间：</label>
                                <input type="text" class="time-input" placeholder="请选择会议结束时间;会议结束时间" name="endTime"/>
                            </li>
                            <li>
                                <label>会议状态;0：未开始；1：进行中；2：已结束：</label>
                                <input type="text" name="conferenceState"/>
                            </li>

                            <!--<li>
                                <label>会议密码;会议密码：</label>
                                <input type="text" name="conferencePassword"/>
                            </li>-->
                            <!--<li>
                                <label>创建人;创建人：</label>
                                <input type="text" name="createdBy"/>
                            </li>
                            <li>
                                <label>创建时间;创建时间：</label>
                                <input type="text" class="time-input" placeholder="请选择创建时间;创建时间" name="createdTime"/>
                            </li>
                            <li>
                                <label>更新人;更新人：</label>
                                <input type="text" name="updatedBy"/>
                            </li>
                            <li>
                                <label>更新时间;更新时间：</label>
                                <input type="text" class="time-input" placeholder="请选择更新时间;更新时间" name="updatedTime"/>
                            </li>
                            <li>
                                <label>删除标识;1：未删除；0：已删除：</label>
                                <input type="text" name="deletionFlag"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>-->
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:conference:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:conference:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:conference:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:conference:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var conferenceState = [[${@dict.getType('system_conference_state')}]];
        var editFlag = [[${@permission.hasPermi('system:conference:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:conference:remove')}]];
        var prefix = ctx + "system/conference";

        $(function() {

            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                startUrl: prefix + "/startAMeeting/{conferenceId}",
                endUrl: prefix + "/endAMeeting/{conferenceId}",
                modalName: "会议",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'conferenceId',
                    title: '主键ID;主键ID',
                    visible: false
                },
                {
                    field: 'conferenceName',
                    title: '会议名称'
                },
                {
                    field: 'beginTime',
                    title: '会议开始时间'
                },
                {
                    field: 'endTime',
                    title: '会议结束时间'
                },
                {
                    field: 'conferenceState',
                    title: '会议状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(conferenceState, value);
                    }
                },
                /*{
                    field: 'conferencePassword',
                    title: '会议密码;会议密码'
                },
                {
                    field: 'createdBy',
                    title: '创建人;创建人'
                },
                {
                    field: 'createdTime',
                    title: '创建时间;创建时间'
                },
                {
                    field: 'updatedBy',
                    title: '更新人;更新人'
                },
                {
                    field: 'updatedTime',
                    title: '更新时间;更新时间'
                },
                {
                    field: 'deletionFlag',
                    title: '删除标识;1：未删除；0：已删除'
                },*/
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.conferenceId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.conferenceId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.startAMeeting(\'' + row.conferenceId + '\')"><i class="fa fa-calendar-check-o" aria-hidden="true"></i>开始会议</a>')
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.endAMeeting(\'' + row.conferenceId + '\')"><i class="fa fa-calendar-minus-o" aria-hidden="true"></i>结束会议</a>');
                        return actions.join('');
                    }
                }]
            };

            $.table.init(options);
        });
    </script>
</body>
</html>